<?
include_once "gblinclude.lib";

$layoutFactory = new CLayoutFactory();
$layoutFactory->setActiveTab("TM_6");
$layoutFactory->setShowLastView(FALSE);
$layoutFactory->addSideBox(createToolBox());

$content = createContent();

$header = $layoutFactory->getHeader();
$tail = $layoutFactory->getTail();
$body = $layoutFactory->getBody($content);
echo $header.$body.$tail;

function createToolBox()
{
	$shortCutBox = new CSideBox("Sub Menu", "");

	$boxItem = new CSideBoxItem("/img/role.gif", "Roles", "/role/rolelist.php");
	$shortCutBox->siteBoxItems[] = $boxItem;
	$boxItem = new CSideBoxItem("/img/user.gif", "Users", "/user/userlist.php");
	$shortCutBox->siteBoxItems[] = $boxItem;
	$boxItem = new CSideBoxItem("/img/config.gif", "Configs", "/config/paramconfig.php");
	$shortCutBox->siteBoxItems[] = $boxItem;

	return $shortCutBox;
}

function createContent()
{
	$content = "";
	$content .= '<div>';
		$content .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
		$content .= '<tr height="40">';
			$content .= '<td valign="middle" class="td_content_title" colspan="3">&nbsp;'.CUIControls::GetImage("", "/img/config-l.gif")."&nbsp;Config";
			$content .= '</td>';
		$content .= '</tr>';
		$content .= '<tr>';
			$content .= '<td>&nbsp;</td>';
			$content .= '<td width="100%">';
				$content .= '<table border="0" cellspacing="0" cellpadding="0" style="margin-top:5px" width="100%">';
					$content .= '<tr>';
						$content .= '<td width="20%" style="padding-left:5px; padding-right:5px" valign="top" align="center">';
							$content .= '<table  width="100%" border="0" cellspacing="2" cellpadding="2" class="config_item_table_style">';
								$content .= '</tr>';
									$content .= '<td height="35px" class="config_item_header_style">&nbsp;'.CUIControls::GetImage("", "/img/role-l.gif").'&nbsp;Roles</td>';
								$content .= '</tr>';
								$content .= '</tr>';
									$content .= '<td valign="top">';
									$content .= '<li style="color:335566"><a href="/role/roleedit.php" class="list_link_style">Add Role<a></li>';
									$content .= '<li style="color:335566"><a href="/role/rolelist.php" class="list_link_style">Role List<a></li>';
									$content .= '</td>';
								$content .= '</tr>';
							$content .= '</table>';
						$content .= '</td>';
						$content .= '<td width="20%" style="padding-left:5px; padding-right:5px" valign="top" align="center">';
							$content .= '<table  width="100%" border="0" cellspacing="2" cellpadding="2" class="config_item_table_style">';
								$content .= '</tr>';
									$content .= '<td height="35px" class="config_item_header_style">&nbsp;'.CUIControls::GetImage("", "/img/user-l.gif").'&nbsp;Users</td>';
								$content .= '</tr>';
								$content .= '</tr>';
									$content .= '<td valign="top">';
									$content .= '<li style="color:335566"><a href="/user/useredit.php" class="list_link_style">Add User<a></li>';
									$content .= '<li style="color:335566"><a href="/user/userlist.php" class="list_link_style">User List<a></li>';
									$content .= '</td>';
								$content .= '</tr>';
							$content .= '</table>';
						$content .= '</td>';
						$content .= '<td width="20%" style="padding-left:5px; padding-right:5px" valign="top" align="center">';
							$content .= '<table  width="100%" border="0" cellspacing="2" cellpadding="2" class="config_item_table_style">';
								$content .= '</tr>';
									$content .= '<td height="35px" class="config_item_header_style">&nbsp;'.CUIControls::GetImage("", "/img/tools-l.gif").'&nbsp;Configs</td>';
								$content .= '</tr>';
								$content .= '</tr>';
									$content .= '<td valign="top">';
									$content .= '<li style="color:335566"><a href="#" class="list_link_style">System Parameter<a></li>';
									$content .= '<li style="color:335566"><a href="/config/enumconfig.php?obj_name=BluetoothClient&attr_name=DeployCountry" class="list_link_style">Country Enum Config<a></li>';
									//$content .= '<li style="color:335566"><a href="/config/enumconfig.php?obj_name=BluetoothClient&attr_name=DeployArea" class="list_link_style">Area Enum Config<a></li>';
									$content .= '<li style="color:335566"><a href="/config/enumconfig.php?obj_name=BluetoothClient&attr_name=DeployProvince" class="list_link_style">Province Enum Config<a></li>';
									$content .= '<li style="color:335566"><a href="/config/enumconfig.php?obj_name=BluetoothClient&attr_name=DeployCity" class="list_link_style">City Enum Config<a></li>';
									$content .= '</td>';
								$content .= '</tr>';
							$content .= '</table>';
						$content .= '</td>';
						$content .= '<td width="40%" style="padding-left:5px; padding-right:5px" valign="top" align="center">';
							$content .= '<table  width="100%" border="0" cellspacing="2" cellpadding="2" class="config_item_table_style">';
								$content .= '</tr>';
									$content .= '<td height="35px" class="config_item_header_style">&nbsp;'.CUIControls::GetImage("", "/img/info-l.gif").'&nbsp;Current Info</td>';
								$content .= '</tr>';
								$content .= '</tr>';
									$content .= '<td valign="top">';
										$content .= '<table border=0 cellspacing="0" cellpadding="0">';
											$content .= '<tr><td nowap width="110px" height="14px">&nbsp;Server Name:</td><td>'.$_SERVER["SERVER_NAME"].'</td></tr>';
											$content .= '<tr><td nowap height="15px">&nbsp;Server Addr:</td><td>'.$_SERVER["SERVER_ADDR"].'</td></tr>';
											$content .= '<tr><td nowap height="15px">&nbsp;Server Port:</td><td>'.$_SERVER["SERVER_PORT"].'</td></tr>';
											$content .= '<tr><td nowap height="15px">&nbsp;Remote Addr:</td><td>'.$_SERVER["REMOTE_ADDR"].'</td></tr>';
											$content .= '<tr><td nowap height="14px">&nbsp;Document Root:</td><td>'.$_SERVER["DOCUMENT_ROOT"].'</td></tr>';
										$content .= '</table>';
									$content .= '</td>';
								$content .= '</tr>';
							$content .= '</table>';
						$content .= '</td>';
					$content .= '</tr>';
				$content .= '</table>';
			$content .= '</td>';
			$content .= '<td>&nbsp;</td>';
		$content .= '</tr>';
		$content .= '</table>';
	$content .= '</div>';
	
	return $content;
}
?>
